//
//  MainViewController.m
//  ENTBoostChat
//
//  Created by zhong zf on 14-8-7.
//  Copyright (c) 2014年 EB. All rights reserved.
//

#import "MainViewController.h"
#import "TalksTableViewController.h"
#import "RelationshipsViewController.h"
#import "ApplicationsViewController.h"
#import "OtherViewController.h"
#import "BlockUtility.h"
#import "AppDelegate.h"

@interface MainViewController ()

@end

@implementation MainViewController

- (id)initWithCoder:(NSCoder *)aDecoder
{
    self = [super initWithCoder:aDecoder];
    if (self) {
        
    }
    return self;
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    
    NSArray* controllers = self.childViewControllers;
    UINavigationController* navController0 = controllers[0];
    UINavigationController* navController1 = controllers[1];
    UINavigationController* navController2 = controllers[2];
    UINavigationController* navController3 = controllers[3];
    
    //解决导航栏覆盖内容的问题
    navController0.navigationBar.translucent = NO;
    navController1.navigationBar.translucent = NO;
    
    //获取tarbar里各个控制器
    self.talksController = navController0.viewControllers[0];
    self.talksController.tabBarController = self;
    
    self.relationshipController = navController1.viewControllers[0];
    self.relationshipController.tabBarController = self;
    
    self.applicationsController = navController2.viewControllers[0];
    self.applicationsController.tabBarController = self;
    
    self.settingViewController = navController3.viewControllers[0];
    self.settingViewController.tabBarController = self;
    
//    //设置tabbar图标及标题
//    UITabBar *tabBar = self.tabBar;
//    
//    UITabBarItem *tabBarItem  = [tabBar.items objectAtIndex:0];
//    [tabBarItem setTitle:@"聊天"];
//    [tabBarItem setImage:[UIImage imageNamed:@"talks"]];
//    
//    UITabBarItem *tabBarItem1  = [tabBar.items objectAtIndex:1];
//    [tabBarItem1 setTitle:@"联系人"];
//    [tabBarItem1 setImage:[UIImage imageNamed:@"relationship"]];
    
//    [trainEnquiryItem setSelectedImage:[UIImage imageNamed:@"tet_hover"]];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)dealloc
{
    NSLog(@"MainViewController dealloc");
}
/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
